﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;

namespace MVCGalloSoftMV5.Models
{
    [Table("Directorio")]
    public class Persona
    {
        [Key]
        public int PersonaId { get; set; }
        [StringLength(50, MinimumLength = 1)]
        [Required(ErrorMessage = "Campo Nombre es requerido.")]
        public string Nombre { get; set; }
        
        [StringLength(100 , MinimumLength=1)]
        [Required(ErrorMessage = "Campo Apellido es requerido.")]
        public string Apellido { get; set; }
        
        [StringLength(100)]
        [EmailAddress(ErrorMessage = "Email invalido.")]
        [Required(ErrorMessage = "Campo Email es requerido.")]
        public string Email { get; set; }
        
        [StringLength(150)]
        [Required(ErrorMessage = "Campo Nextel es requerido.")]
        public string Nextel { get; set; }
        
        [StringLength(15)]
        [Required(ErrorMessage = "Campo Celular es requerido.")]
        public string Celular { get; set; }
        
        [StringLength(15)]
        [Required(ErrorMessage = "Campo Teléfono es requerido.")]
        public string Telefono { get; set; }
        
        [NotMapped]
        [Display(Name = "Nombre Completo")]
        public string NombreCompleto {
            get { 
                return Nombre + " " +Apellido;
            }
        }

    }
}
